﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

 <ul id="top-menu">
            <li>
                <a href="" class="icons icon-creat"> </a>
                <h5>
                   <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step1">Create new item </a></h5>
                
                    
              </li>
              <li>
                <a href="" class="icons icon-search"></a>
                <h5>
                    <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Search" id="fancyseach"> Search </a></h5>
              
          </h5>
              
              </li>  
              <li>
                 <a href="" class="icons icon-list"></a>
                <h5>
                     <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>">View All (<span data-bind="text: (countActive() + countDraft() + countDelete()) "></span>)</a></h5>
               
                    
              </li>     
               <li>
                 <a href="" class="icons icon-list"></a>
                <h5>
                     <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Index/1">View Active (<span data-bind="text: (countActive)"></span>)</a></h5>
               
                    
              </li>  
              <li>
                 <a href="" class="icons icon-list"></a>
               <h5>
                   <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Index/2"> View Draft (<span data-bind="text: countDraft"></span>)</a></h5>
               
                    
              </li>  
               <li>
                <a href="" class="icons icon-list"></a>
               <h5>
                   <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Index/3"> View Deleted (<span data-bind="text: countDelete"></span>)</a></h5>
                
                    
              </li>  
         </ul>
         

<script type="text/javascript">
    $(document).ready(function() {

    //
    $("#fancyseach").qtip(
		{
		    content: {
		        // Set the text to an image HTML string with the correct src URL to the loading image you want to use
		    text: $("#fancy_search"),
		        
		        title: {
		            text: 'Search form', // Give the tooltip a title using each elements text
		            button: true
		        }
		    },
		    position: {
		    at: 'left bottom', // Position the tooltip above the link
		    my: 'right center',
		        viewport: $(window), // Keep the tooltip on-screen at all times
		        effect: true // Disable positioning animation
		    },
		    show: {
		        event: 'click',
		        solo: true // Only show one tooltip at a time
		    },
		    hide: 'unfocus',
		    style: {
		    classes: 'qtip-wiki qtip-shadow qtip-bootstrap'
		    }
		})

        
        //
        var controllerMVC = '<%=Html.ViewContext.Controller.ValueProvider.GetValue("controller").RawValue%>';
        var pageAjax = '<%=ViewData["AjaxPage"].ToString()%>';
        $.ajaxSetup({ cache: false });
        System.Data.CoutStatusModel = function() {
            var self = this;
            self.countActive = ko.observable();
            self.countDraft = ko.observable();
            self.countDelete = ko.observable();
            (function() {
                $.getJSON(BASE_URL + "Listings/Ajax/" + pageAjax + controllerMVC, function(result) {
                    //fill data
                    self.countActive(result.Data[0].countActive);
                    self.countDraft(result.Data[0].countDraft);
                    self.countDelete(result.Data[0].countDelete);

                });
            })();

        }
        //
        var vmCountStatus = new System.Data.CoutStatusModel();

        ko.applyBindings(vmCountStatus, $("#top-menu")[0]);
    });
</script>

